package cn.rongdao.jrkabao.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

/**
 * Created by WANG on 17/11/10.
 */

public class InterceptorTouchEventRelativeLayout extends RelativeLayout{

    private boolean interceptorTouchEvent = false;

    public InterceptorTouchEventRelativeLayout(Context context) {
        super(context);
    }

    public InterceptorTouchEventRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public InterceptorTouchEventRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if(interceptorTouchEvent){
            return true;
        }else {
            return super.onTouchEvent(event);
        }
    }

    public void setInterceptorTouchEvent(boolean interceptorTouchEvent) {
        this.interceptorTouchEvent = interceptorTouchEvent;
    }
}
